package com.lovo;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * 登录面板
 */
public class LoginPanel extends JPanel implements ActionListener {
    private JButton loginBtn;
    private Test02 frame;
    public LoginPanel(Test02 frame){
        this.frame = frame;
        this.setLayout(null);

        this.setOpaque(false);
        JLabel titleLabel = new JLabel("登录");
        titleLabel.setBounds(200,50,100,50);
        this.add(titleLabel);

        loginBtn = new JButton("登录");
        loginBtn.setBounds(200,150,100,50);
        this.add(loginBtn);
        loginBtn.addActionListener(this);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if(e.getSource() == loginBtn){
            frame.switchPanel("menu");
        }
    }
}
